package com.fengze.business.service.impl;

import java.util.List;

import com.fengze.business.vo.ClientLibraryVO;
import com.fengze.common.annotation.AutoSetInsertValue;
import com.fengze.common.annotation.AutoSetUpdateValue;
import com.fengze.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fengze.business.mapper.ClientLibraryMapper;
import com.fengze.business.domain.ClientLibrary;
import com.fengze.business.service.IClientLibraryService;

/**
 * 客户信息库Service业务层处理
 * 
 * @author lug
 * @date 2024-01-31
 */
@Service
public class ClientLibraryServiceImpl implements IClientLibraryService 
{
    @Autowired
    private ClientLibraryMapper clientLibraryMapper;

    /**
     * 查询客户信息库
     * 
     * @param id 客户信息库主键
     * @return 客户信息库
     */
    @Override
    public ClientLibrary selectClientLibraryById(Long id)
    {
        return clientLibraryMapper.selectClientLibraryById(id);
    }

    /**
     * 查询客户信息库列表
     * 
     * @param clientLibrary 客户信息库
     * @return 客户信息库
     */
    @Override
    public List<ClientLibrary> selectClientLibraryList(ClientLibrary clientLibrary)
    {
        return clientLibraryMapper.selectClientLibraryList(clientLibrary);
    }

    /**
     * 新增客户信息库
     * 
     * @param clientLibrary 客户信息库
     * @return 结果
     */

    @AutoSetInsertValue
    @Override
    public int insertClientLibrary(ClientLibrary clientLibrary)
    {
        clientLibrary.setCreateTime(DateUtils.getNowDate());
        return clientLibraryMapper.insertClientLibrary(clientLibrary);
    }

    /**
     * 修改客户信息库
     * 
     * @param clientLibrary 客户信息库
     * @return 结果
     */
    @AutoSetUpdateValue
    @Override
    public int updateClientLibrary(ClientLibrary clientLibrary)
    {
        clientLibrary.setUpdateTime(DateUtils.getNowDate());
        return clientLibraryMapper.updateClientLibrary(clientLibrary);
    }

    /**
     * 批量删除客户信息库
     * 
     * @param ids 需要删除的客户信息库主键
     * @return 结果
     */
    @Override
    public int deleteClientLibraryByIds(Long[] ids)
    {
        return clientLibraryMapper.deleteClientLibraryByIds(ids);
    }

    /**
     * 删除客户信息库信息
     * 
     * @param id 客户信息库主键
     * @return 结果
     */
    @Override
    public int deleteClientLibraryById(Long id)
    {
        return clientLibraryMapper.deleteClientLibraryById(id);
    }

    @Override
    public ClientLibraryVO selectClientLibraryVOById(Long id) {
        return clientLibraryMapper.selectVOById(id);
    }

    @Override
    public List<ClientLibraryVO> selectClientLibraryVOList(ClientLibrary clientLibrary) {
        return clientLibraryMapper.selectVOList(clientLibrary);
    }
}
